import React, { Component } from 'react';
import './App.css';
import { BrowserRouter, Switch, Route} from 'react-router-dom';
import routes from './router/route.ts'

class App extends Component {
   render () {
    return (
      <div className="App">
        <div className='app-mask d-flex flex-column'>
          <div className="flex-fill">
            <BrowserRouter>
              <Switch>
                {
                  routes.map(route => {
                    return (
                      <Route
                        key = { route.path }
                        path = { route.path }
                        component = { route.component } />
                    )
                  })
                }
                {/* <Redirect exact from = '/'  to = { routes[0].path } />
                <Redirect to = '/404' /> */}
              </Switch>
            </BrowserRouter>
          </div>
        </div>
      </div>
    );
  }
  
}

export default App;
